package com.hw.dagl.model;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;


@Entity
@Table(name = "SYS_ROLE", schema = "HWBIGDATA")
public class Sys_Role implements java.io.Serializable{
	
	private String rid;//VARCHAR2(20)	N			角色ID
	private String rname;//	VARCHAR2(50)	N			角色名称
	private String cjr;//VARCHAR2(32)	Y			角色创建�?
	private Date cjsj;//DATE	N	sysdate		角色创建时间
	private String ipks;//VARCHAR2(64)	Y	'0.0.0.0'		登录IP起始
	private String ipjs;//VARCHAR2(64)	Y	'0.0.0.0'		登录IP结束
	private Date jsyxq;//	DATE	Y			角色有效�?
	private String cjrxm;//角色创建人姓�?
	private String shqx;	//VARCHAR2(1)	Y			0无审核权限，1有审核权限
	
	@Id
	@Column(name = "RID", nullable = false, length = 20)
	public String getRid() {
		return rid;
	}
	public void setRid(String rid) {
		this.rid = rid;
	}
	@Column(name = "RNAME",nullable = false, length = 50)
	public String getRname() {
		return rname;
	}
	public void setRname(String rname) {
		this.rname = rname;
	}
	@Column(name = "CJR", length = 32)
	public String getCjr() {
		return cjr;
	}
	public void setCjr(String cjr) {
		this.cjr = cjr;
	}
	@Temporal(TemporalType.DATE)
	@Column(name = "CJSJ")
	public Date getCjsj() {
		return cjsj;
	}
	public void setCjsj(Date cjsj) {
		this.cjsj = cjsj;
	}
	@Column(name="IPKS", length=64)
	public String getIpks() {
		if(ipks==null)
			ipks="0.0.0.0";
		return ipks;
	}
	public void setIpks(String ipks) {
		this.ipks = ipks;
	}
	@Column(name="IPJS", length=64)
	public String getIpjs() {
		if(ipjs==null)
			ipjs="0.0.0.0";
		return ipjs;
	}
	public void setIpjs(String ipjs) {
		this.ipjs = ipjs;
	}
	@Temporal(TemporalType.DATE)
	@Column(name="JSYXQ")
	public Date getJsyxq() {
		return jsyxq;
	}
	public void setJsyxq(Date jsyxq) {
		this.jsyxq = jsyxq;
	}
	@Column(name="SHQX", length=1)
	public String getShqx() {
		return shqx;
	}
	public void setShqx(String shqx) {
		this.shqx = shqx;
	}
	@Transient
	public String getCjrxm() {
		return cjrxm;
	}
	public void setCjrxm(String cjrxm) {
		this.cjrxm = cjrxm;
	}
	@Transient
	public String getCjsjStr() {
		if(cjsj!=null){
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			return sdf.format(cjsj);
		}
		return "";
	}
	@Transient
	public String getJsyxqStr() {
		if(jsyxq!=null){
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			return sdf.format(jsyxq);
		}
		return "";
	}
}
